<?php

namespace Modules\Cart\Http\Controllers\API;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Cart\Services\CartService;

class CartController extends Controller
{
    public function list(CartService $cartService)
    {
        return $cartService->all()->get();
    }

    public function add(Request $request, CartService $cartService) 
    {
        return $cartService->add(
            $request->id, 
            $request->channel,
            $request->name, 
            $request->qty, 
            $request->price
        );
    }

    public function clear()
    {
        // Cart::emptyCart();
    }
}
